package com.xiaoyao.novel.service;

import java.sql.SQLException;

import com.xiaoyao.novel.dao.WebInfoDao;
import com.xiaoyao.novel.pojo.WebInfo;

public class WebInfoService extends BaseService<WebInfo> {
	private static WebInfoDao dao = new WebInfoDao();
	private static WebInfo staticWeb = null; // 持久化

	public WebInfoService() {
		super(dao);
	}

	public WebInfo getWebInfo() {
		WebInfo webInfo = null;
		try {
			webInfo = dao.getOne();
		} catch (SQLException e) {
			// e.printStackTrace();
			logger.error(e);
		}
		return webInfo;
	}

	public WebInfo getStaticWebInfo() {
		if (staticWeb == null) {
			staticWeb = getWebInfo();
		}
		return staticWeb ;
	}
	@Override
	public void update(WebInfo object) {
		super.update(object);
		staticWeb =object ;
	}
	

}
